﻿@{  
    var eventName = "My New Event";
    var startDate = System.DateTime.UtcNow.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
    var endDate = System.DateTime.UtcNow.AddDays(3).ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
    var timezone = "GMT+01";
    var organizerId = 667738679;
    var venueId = 611185;
    
    if(IsPost)
    {
        eventName = Request["event_name"];
        startDate = Request["start_date"];
        endDate = Request["end_date"];
        timezone = Request["timezone"];
        organizerId = Request["organizer_id"].AsInt();
        venueId = Request["venue_id"].AsInt();
        Eventbrite.CreateNewEvent(eventName, startDate, endDate, timezone, organizerId, venueId);        
    }    
}
<h3>Eventbrite.CreateNewEvent() Method</h3>
<a name="CreateNewEvent"></a>
<pre class="codePre">@@{  
    Eventbrite.CreateNewEvent(eventName, startDate, endDate, timezone, organizerId, venueId);
}</pre>

@if (IsPost) {
    <div class="message success">
        <strong>New Event created! </strong>You will find the new event in the <a href="@Href("~/GetUserEventList")">event list</a>.
    </div>
}

<p>Type your event information below (or use the default values) to test the helper method:</p>
<form class="createNew" method="post" action="">
    <label for="event_name">Event Name:</label>
    <input type="text" id="event_name" name="event_name" value="@eventName" /><br/>    
    
    <label for="start_date">Start Date: </label>
    <input type="text" id="start_date" name="start_date" value="@startDate" /><br/>    
    
    <label for="end_date">End Date: </label>
    <input type="text" id="end_date" name="end_date" value="@endDate" /><br/>
    
    <label for="timezone">Timezone: </label>
    <input type="text" id="timezone" name="timezone" value="@timezone" /><br/>
    
    <label for="venue_id">Venue Id: </label>
    <input type="text" id="venue_id" name="venue_id" value="@venueId" /><br/>
    
    <label for="organizer_id">Organizer Id: </label>
    <input type="text" id="organizer_id" name="organizer_id" value="@organizerId" /><br/>
    
    <input type="submit" value="Create New Event" />
</form>




